﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BLL.User;

namespace WebApplication
{
    public partial class Artists : System.Web.UI.Page
    {
        public int totalCount = -1;

        public int pageIndex = 1;

        public int pageSize = 36;

        private UserService userService = new UserService();

        public List<Models.User> users = new List<Models.User>();

        protected void Page_Load(object sender, EventArgs e)
        {
            string type = Request.QueryString["type"];
            string style = Request.QueryString["style"];
            string pageNo = Request.QueryString["pageIndex"];

            if (string.IsNullOrEmpty(type))
            {
                type = "@";
            }

            if (string.IsNullOrEmpty(style))
            {
                style = "@";
            }

            string[] tags = new string[] { type, style };


            if (!String.IsNullOrEmpty(pageNo))
            {
                pageIndex = Convert.ToInt32(pageNo);
            }

            users = userService.GetList(ref totalCount, tags, pageIndex, pageSize);

        }
    }
}